#!/usr/bin/python
# -*- encoding: utf-8 -*-

import sys
from parseur import parse

if __name__ == "__main__":
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        print "Argument manquant."
        exit(1)
    rom = parse("".join(f.readlines()))
    f.close()

    rom.restart () 
    while not rom.end ():
        raw_input('Next instruction... ')
        ins = rom.next()
        print ins
        print rom.getMemory()
